<?php


namespace Yond\LaravelDomain\Console\Traits;

use Yond\LaravelDomain\Console\Command;

/**
 * Trait FileSystemTrait
 * @mixin Command
 */
trait FileSystemTrait
{
    protected function ensureDirectoryExists($path)
    {
        $this->files->ensureDirectoryExists($path);
    }

    protected function alreadyExists($path): bool
    {
        $existed = $this->files->exists($path);
        if ($existed) {
            $this->error($path . ' already existed');
        }
        return $existed;
    }

}